<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        //后台 -> json -> Result { code data : []  msg ... } -> 前端

        var result = {code:200,data:"哈哈哈,你成功了!!"};

        if(result.code == 200){
            console.log(result.data);
        }

        //解构
        let {code,data} = result;
        if(code == 200){
            console.log(data);
        }


    </script>
</body>
</html>